package com.whmnx.base.utils;

import android.view.View;
import android.view.ViewStub;
import android.widget.ImageView;
import android.widget.TextView;

import com.whmnx.base.R;


/**
 * @author yjyvi
 * @data 2018/4/16.
 * 显示空布局
 */

public class EmptyListUtils {

    public static void loadEmpty(boolean flag,  ViewStub viewStub,int type) {
        if (viewStub.getParent() != null) {
            View view = viewStub.inflate();
            ImageView imageView = (ImageView) view.findViewById(R.id.img_empty);
            TextView tv_empty = (TextView) view.findViewById(R.id.tv_empty);
        }
        if (type == 0){
            viewStub.setVisibility(View.VISIBLE);
        }

        if (flag) {
            viewStub.setVisibility(View.VISIBLE);
        } else {
            viewStub.setVisibility(View.GONE);
        }
    }
}
